<template>
<view class="public-transfer">
  <view class="pay-for-panel">
    <view class="pay-for-panel__icon">
      <image class="icon" :src="payForPanelIconUrl"/>
    </view>
    <view class="pay-for-panel__tips">
      请你联系公司财务在 {{ deadLineTime }} 前完成以下汇款，否则将支付失败
    </view>

    <view class="cell">
      <view class="main">
        <view class="label">
          支付金额
        </view>
        <view class="value">
          ¥ {{price}}元
        </view>
      </view>
      <view class="desc">
        请汇入指定金额，非指定金额将支付失败。
      </view>
    </view>

    <view class="cell">
      <view class="main">
        <view class="label">
          收款账号
        </view>
        <view class="value account">
          270320500000076
        </view>
      </view>
      <view class="desc">
        每个注册账号对成的25位收款账号不同，请勿重复打款
      </view>
    </view>

    <view class="cell">
      <view class="main">
        <view class="label">
          收款公司名
        </view>
        <view class="value">
          贵阳高新产业投资（集团）有限公司
        </view>
      </view>
    </view>

    <view class="cell">
      <view class="main">
        <view class="label">
          开户银行
        </view>
        <view class="value">
          贵阳农商银行龙王支行
        </view>
      </view>
    </view>

    <view class="cell">
      <view class="main">
        <view class="label">
          备注信息
        </view>
        <view class="value">
          {{ payName }} 支付
        </view>
      </view>
    </view>
  </view>
  <view class="other-info-panel">
    <text class="desc">
      请使用与主体一致的对公账号汇款。
    </text>
    <view class="cell">
      <view class="main">
        <view class="label">
          汇款账户名称
        </view>
        <view class="value">
          贵阳高新智慧运营管理有限公司
        </view>
      </view>
    </view>
    <view class="tips">
      <text class="desc">
        温馨提示：若取消预定，请联系我们线下办理退款。
      </text>
      <text class="desc">
        联系电话：0851-84766886/18985546686
      </text>
    </view>
  </view>
  <view class="fixed-btn">
    <up-button
        class="btn__update-certificate"
        shape="circle"
        text="上传凭证"
        color="linear-gradient(to right, #FF934C, #FC686F)"
        @tap="handleUpdateCertificateBtnClick"
    />
  </view>
</view>
</template>
<script setup>
import {inject, ref} from "vue";
import {onLoad, onShow} from "@dcloudio/uni-app";
import {getFormattedDateAfterDays, getUrlParamsInH5, getUrlParamsInWeixin} from "@/utils/utils";
import {customNav} from "@/utils/customNav";

const imgUrlPrefix = inject('baseImgUrl')
const payForPanelIconUrl = `${imgUrlPrefix}2024-04-26/1714111929431shijian@2x.png`
const orderId = ref('')
const price = ref(0)
const payName = ref('')
const orderData = ref('')
const handleUpdateCertificateBtnClick = () => {
  customNav(`update-certificate?orderId=${orderId.value}&payName=${payName.value}&orderData=${orderData.value}`)
}

const deadLineTime = ref('')
onShow(() => {
  deadLineTime.value = getFormattedDateAfterDays(3, 'ymd')
})

onLoad(() => {
  /* #ifdef MP-WEIXIN */
  orderId.value = getUrlParamsInWeixin()?.orderId
  price.value = getUrlParamsInWeixin()?.price
  payName.value = getUrlParamsInWeixin()?.payName
  orderData.value = getUrlParamsInWeixin()?.orderData
  console.log(orderData.value)
  /* #endif */

  /* #ifndef MP-WEIXIN */
  orderId.value = getUrlParamsInH5()?.orderId
  price.value = getUrlParamsInH5()?.price
  payName.value = getUrlParamsInH5()?.payName
  /* #endif */
})
</script>
<style scoped lang=less>
@import "./style/public-transfer";
</style>
